home *** CD-ROM | disk | FTP | other *** search
/ Harvard Graphics 4.0 / Harvard Graphics 4.0 for Windows 95 - SPC (1995) - Disk 09 of 13.img / PROGRAM.9 / Tutorial / T3DATA.DXR / 00001.ls next >
Encoding:
Text File  |  1995-09-12  |  4.4 KB  |  232 lines

  1. on startMovie
  2.   set centerStage to 1
  3. end
  4.  
  5. on init
  6.   global flipOut, slipOut
  7.   set the mouseUpScript to EMPTY
  8.   set the stageColor to 8
  9.   set flipOut to EMPTY
  10.   set slipOut to EMPTY
  11.   installMenu(0)
  12. end
  13.  
  14. on flipNull
  15.   global flipOut, slipOut
  16.   set flipOut to EMPTY
  17.   set slipOut to EMPTY
  18. end
  19.  
  20. on flipRightArrow
  21.   flip("arrow")
  22. end
  23.  
  24. on slipLeftArrow
  25.   slip("arrow")
  26. end
  27.  
  28. on flip fromWhat
  29.   global flipOut, globalAction, keyBuff
  30.   set globalAction to "flip" & fromWhat
  31.   if flipOut = EMPTY then
  32.     if the frame <> 43 then
  33.       go(the frame + 1)
  34.     end if
  35.   else
  36.     go(marker(flipOut))
  37.   end if
  38.   if the key <> ENTER then
  39.     set keyBuff to the key
  40.   else
  41.     set keyBuff to EMPTY
  42.   end if
  43.   set the keyDownScript to EMPTY
  44. end
  45.  
  46. on slip fromWhat
  47.   global slipOut, globalAction
  48.   set globalAction to "slip" & fromWhat
  49.   if slipOut = EMPTY then
  50.     if the frame > 2 then
  51.       go(the frame - 1)
  52.     end if
  53.   else
  54.     go(marker(slipOut))
  55.     set slipOut to EMPTY
  56.   end if
  57. end
  58.  
  59. on menuFlipCheck whichMenu
  60.   global activeMenu
  61.   if whichMenu = activeMenu then
  62.     flip()
  63.   end if
  64. end
  65.  
  66. on flipSlip f, s
  67.   global flipOut, slipOut
  68.   set flipOut to f
  69.   set slipOut to s
  70. end
  71.  
  72. on setOrigin
  73.   global origin
  74.   set origin to the frame
  75. end
  76.  
  77. on returnOrigin
  78.   global origin
  79.   if origin <> 0 then
  80.     go(origin)
  81.   end if
  82. end
  83.  
  84. on NextBullet
  85.   if the key <> RETURN then
  86.     set the castNum of sprite 12 to the number of cast "diamondBullet"
  87.   else
  88.     flip()
  89.   end if
  90. end
  91.  
  92. on checkDataForm
  93.   if the key = RETURN then
  94.     flip()
  95.   end if
  96.   copyText("enterText")
  97. end
  98.  
  99. on copyText whichCastField
  100.   global whichCell, lastText
  101.   if the text of cast whichCastField <> EMPTY then
  102.     if the number of chars in the text of cast whichCastField > 4 then
  103.       set the text of cast whichCastField to lastText
  104.     end if
  105.     set lastText to the text of cast whichCastField
  106.     updateStage()
  107.     if the key = BACKSPACE then
  108.       set charsTyped to the number of chars in the text of cast whichCell
  109.       set the text of cast whichCell to chars(the text of cast whichCell, 1, charsTyped - 1)
  110.     else
  111.       set the text of cast whichCell to the text of cast whichCastField & the key
  112.     end if
  113.   else
  114.     set the text of cast whichCell to the key
  115.   end if
  116. end
  117.  
  118. on checkKey whatKey
  119.   global whatAction
  120.   if the key = whatKey then
  121.     whatAction()
  122.   end if
  123. end
  124.  
  125. on puppetize fromSprite, toSprite, state
  126.   repeat with channel = fromSprite to toSprite
  127.     puppetSprite(channel, state)
  128.   end repeat
  129. end
  130.  
  131. on checkRollOver fromSprite, toSprite
  132.   global currentSprite, oldRollover
  133.   repeat with channel = fromSprite to toSprite
  134.     if rollOver(channel) = 1 then
  135.       if currentSprite <> channel then
  136.         set currentSprite to channel
  137.         popMenu()
  138.       end if
  139.     end if
  140.   end repeat
  141. end
  142.  
  143. on popMenu
  144.   global oldRollover, currentSprite
  145.   set the ink of sprite currentSprite to 2
  146.   if oldRollover <> currentSprite then
  147.     set the ink of sprite oldRollover to 36
  148.   end if
  149.   set oldRollover to currentSprite
  150.   updateStage()
  151. end
  152.  
  153. on fixit
  154.   if the mouseCast = 327 then
  155.     cleanupmenu()
  156.   else
  157.     repeat while the mouseDown = 0
  158.       checkRollOver(5, 12)
  159.     end repeat
  160.   end if
  161. end
  162.  
  163. on fixitmore
  164.   if the mouseCast = 327 then
  165.     cleanupmenu()
  166.   else
  167.     repeat while the mouseDown = 0
  168.       checkRollOver(6, 14)
  169.     end repeat
  170.   end if
  171. end
  172.  
  173. on cleanupmenu
  174.   global flipOut
  175.   set the mouseUpScript to EMPTY
  176.   set flipOut to EMPTY
  177.   flip()
  178.   updateStage()
  179. end
  180.  
  181. on flipKey
  182.   set the keyDownScript to EMPTY
  183.   flip()
  184. end
  185.  
  186. on showBullet vSprite, state
  187.   set the visible of sprite vSprite to state
  188. end
  189.  
  190. on checkKeyCode whatKeyCode
  191.   put the keyCode
  192.   if the keyCode = whatKeyCode then
  193.     flip()
  194.   end if
  195. end
  196.  
  197. on clickFlip buttDown, buttUp, Action1
  198.   set the castNum of sprite the clickOn to the number of cast buttDown
  199.   repeat while the stillDown
  200.     if the mouseCast = the number of cast buttUp then
  201.       set the castNum of sprite the clickOn to the number of cast buttDown
  202.       updateStage()
  203.     end if
  204.     if the mouseCast = the number of cast buttDown then
  205.       nothing()
  206.     else
  207.       set the castNum of sprite the clickOn to the number of cast buttUp
  208.       updateStage()
  209.     end if
  210.     updateStage()
  211.   end repeat
  212.   if the mouseCast = the number of cast buttDown then
  213.     set the castNum of sprite the clickOn to the number of cast buttUp
  214.     updateStage()
  215.     do(Action1)
  216.   end if
  217. end
  218.  
  219. on hoofItHome
  220.   go(1, the pathName & "Home")
  221. end
  222.  
  223. on hoofItT4
  224.   go(1, the pathName & "T4cust")
  225. end
  226.  
  227. on hoofItOut
  228.   unLoadCast()
  229.   clearGlobals()
  230.   quit()
  231. end
  232.